package com.feishi.project.webbase.dao;

import com.feishi.project.webbase.bean.Student;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: caixq
 * Date: 2019-03-04
 * Time: 下午4:52
 */
public interface StudentDao  extends PagingAndSortingRepository<Student, String>, JpaSpecificationExecutor<Student> {
    @Query(" from Student t where id = :id or code = :id or name= :id")
    List<Student> queryUserList(@Param("id") String id);
    @Query(" from Student t where name = :username ")
    Student getStudentByName(String username);
//    @Query(value = "select * from users u where u.uid in (SELECT c.openid from shlaunch.userconnect c where wechat=?)", nativeQuery = true )
//    List<Student> queryWechatUserList(@Param("id") String id);
}
